package br.com.fromtis.jsf.util;

import javax.faces.event.PhaseEvent;
import javax.faces.event.PhaseId;
import javax.faces.event.PhaseListener;



public class LifeCycleListener implements PhaseListener{

	@Override
    public void afterPhase ( PhaseEvent event ) {
	    System.out.println( "DEPOIS PHASE " + event.getPhaseId());
    }

	@Override
    public void beforePhase ( PhaseEvent event ) {
		if( event.getPhaseId().equals( PhaseId.RESTORE_VIEW )) {
			System.out.println("<-------------Iniciando PhaseListener ----------------->");
		}
	    System.out.println( "ANTES PHASE " + event.getPhaseId() );
    }

	@Override
    public PhaseId getPhaseId () {
	    return PhaseId.ANY_PHASE;
    }
	
}
